<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ page isELIgnored="false"%>
<%@ include file="../common/taglibs.jsp"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="renderer" content="webkit">
<title>黑名单审核</title>
<link rel="icon" href="favicon.ico" type="image/x-icon"/>
<!-- 当前页面样式 -->
<link rel="stylesheet" href="<s:url value="/css/common.css"/>"/>
<script type="text/javascript" src="<c:url value="/js/My97DatePicker/WdatePicker.js"/>"></script>
<!-- 当前页面样式 END -->
<style type="text/css">
.blue{
	color: blue
}
</style>
<script type="text/javascript"
	src="<c:url value="/js/jquery-1.3.2.js" />"></script>
<script type="text/javascript">

function   str2date(str){   
	  var   d=null;   
	  var   reg=/^(\d{4})(\d{2})(\d{2})$/  ;
	  if(arr=str.match(reg))d=new   Date(Number(arr[1]),Number(arr[2])-1,Number(arr[3])) ; 
	  return   d;   
	  }
	  
function subForm() {
	var beginTime = $("#minDate").val();
	var endTime = $("#maxDate").val();
	if (!endTime || !beginTime) {
		alert("起始时间范围必须选择!");
		return false;
	}
	var date1 = str2date(beginTime);
	var date2 = str2date(endTime);

	if (date1.getMonth() != date2.getMonth()) {
		alert("选择的起始时间不在同一个月内！");
		return false;
	}
	if(date1>date2){
		alert("结束时间不能小于开始时间");
		return false;
	}
	return true;
} 




$(document).ready(function(){
		loadTitle();
		$('#changeType').change(function(){
			loadTitle();
		});
		$('#sub').click(function(){
			$("#queryForm").attr("action","<%=basePath%>/blackAudit/blackAuditlistview.ct");
			$("#queryForm").submit();
			$(this).attr("disabled","true");
		});
		
		
	});	
	function loadTitle()
	{
		var type=$('#changeType').val();
		if(type=='C')
		{
			$('#blackNum').text('卡号 :');
		    $('#title').text('卡号');
		}
		else if(type=='M')
		{
			$('#blackNum').text('商户号 ：');
			$('#title').text('商户号');
		}
		else if(type=='D')
		{
			$('#blackNum').text('法人身份证号  ：');
			$('#title').text('法人身份证号');
		}
		else if(type=='N')
		{
			$('#blackNum').text('非法人身份证号 ：');
			$('#title').text('非法人身份证号');
		}
		else if(type=='O')
		{
			$('#blackNum').text('营业执照 ：');
			$('#title').text('营业执照号码');
		}
		else if(type=='P')
		{
			$('#blackNum').text('手机号 ：');
			$('#title').text('手机号 ');
		}
		else{
			$('#blackNum').text('商户号或卡号 ：');
			$('#title').text('商户号或卡号');
		}
	}
	//审核不通过
	function noPass(blackNum)
	{	$("#queryForm").attr("action","<%=basePath%>/blackAudit/blackAuditNoPass.ct?black.blackNum="+blackNum);
		$("#queryForm").submit();
	}
	
	//同意
	function pass(blackNum){
		$("#queryForm").attr("action","<%=basePath%>/blackAudit/blackAuditPass.ct?black.blackNum="+blackNum);
		$("#queryForm").submit();
	}
	
	
	
</script>
</head>

<body>
		<s:form id="queryForm" action="/blackAudit/blackAuditlistview.ct" method="post"  theme="simple">
			<table class="tb">
				<tbody>
				<tr class="tb-line">
            		<td class="tb-td" colspan="6"><div class="tb-h2">POS收单运营管理平台</div></td>
        		</tr>
				 <tr class="tb-line">
					<td class="tb-td" colspan="6">
						<div class="tb-h3">黑名单审核</div>
					</td>
				</tr>

				 <tr class="tb-line">
				  <td width="12%" style="min-width: 150px" align="right" class="tb-td">
                      <div class="tb-h4">类型：</div>
                  </td>
				  <td class="tb-td">
                       <label class="tb-select">
				            <s:select name="searchCondition.blackType" list="#{'C':'黑卡','M':'黑商户','D':'法人身份证','N':'非法人身份证','P':'手机号','O':'营业执照'}" headerKey="" headerValue="不限" cssClass="queryWidth" id="changeType"/> 
                       </label>
                </td>
				 
				 	<td width="12%" style="min-width: 150px" align="right" class="tb-td">
				 	 <div class="tb-h4" id="blackNum">商户号或卡号：</div>
				 	 </td>
					<td class="tb-td">
                		<label class="tb-input-normal">
						    <s:textfield  name="searchCondition.blackNum" cssClass="queryWidth" />
						</label>
					</td>
                </tr>
                
      <tr class="tb-line">
              <td width="12%" style="min-width: 150px" align="right" class="tb-td">
                <div class="tb-h4">状态：</div>
            </td>
            <td class="tb-td">
                	<label class="tb-select">
						<s:select name="searchCondition.status" list="#{'2':'待审核'}" headerKey="" headerValue="不限" cssClass="queryWidth" /> 
					</label>
			</td>
        	<td width="12%" style="min-width: 150px" align="right" class="tb-td">
                <div class="tb-h4">添加日期：</div>
            </td>
            <td class="tb-td">
                <label class="tb-input-mini"><s:textfield id="minDate"  name="searchCondition.minDate" 
                onfocus="WdatePicker({dateFmt:'yyyyMMdd',readOnly:true,wdate:true,errDealMode:0});" 
                /></label> -<label class="tb-input-mini"><s:textfield id="maxDate"  name="searchCondition.maxDate" 
                onfocus="WdatePicker({dateFmt:'yyyyMMdd',readOnly:true,wdate:true,errDealMode:0});" 
                /></label> 
             </td>
																	
				</tr>
				<tr>
						<td colspan="7" align="center"><span style="color: red"><s:actionerror /></span>
							<span style="color: red;"><s:actionmessage /></span > <span style="color: red;"><s:fielderror
									cssClass="fieldError" /></span>
							<span id="otherError"></span>
						</td>
					</tr>
				 <tr class="tb-line">
           		 <td class="tb-td line-submit" align="right" colspan="7">
                <label class="tb-input-submit"><input type="button" value="查询" id="sub"/></label>
				<label class="tb-input-submit"><s:reset value="取 消" /></label> 
				 
				</td>
				</tr>
				
				<s:if
					test="#request.searchRsList != null && #request.searchRsList.size>0">
					<tr class="tb-line">
						<td class="tb-td paging" colspan="7"><page:pageCount
								max_pages="11" totalPage="${requestScope.totalPage}"
								currentPage="${requestScope.currentPage}"
								action="${rootPath}/blackAudit/blackAuditlistview.ct?currentPage=" />

						</td>
					</tr>
				</s:if>
			</table>
			
				
	<div class="big-tb">
    <table class="tb" style="width: 100%;">
				<thead>
            	<tr class="tb-line">
                <th class="tb-th" colspan="7"><div class="tb-h3">待审核黑名单列表</div></th>
            	</tr>
					 <tr class="tb-line bg-gray">
						<th class="tb-th" id="title">商户号或卡号</th>	
						<th class="tb-th">类型</th>		
						<th class="tb-th">日期</th>
						<th class="tb-th">时间</th>
						<th class="tb-th">原因</th>
						<th class="tb-th">添加人</th>
						<th class="tb-th">审核操作</th>
					</tr>
				</thead>
				<tbody>
					<s:iterator value="#request.blackList" status="stat" id="bean">
							<tr class="tb-line" >
							<td class="tb-td"><s:property value="#bean.blackNum"/></td>
							<td class="tb-td">
							<s:if test="#bean.blackType == \"C\"">黑卡</s:if>
							<s:elseif test="#bean.blackType == \"M\"">黑商户</s:elseif>
							<s:elseif test="#bean.blackType == \"D\"">法人身份证</s:elseif>
							<s:elseif test="#bean.blackType == \"N\"">非法人身份证</s:elseif>
							<s:elseif test="#bean.blackType == \"P\"">手机号</s:elseif>
							<s:elseif test="#bean.blackType == \"O\"">营业执照</s:elseif>
							</td>
							<td class="tb-td"><s:property value="#bean.date"/></td>
							<td class="tb-td"><s:property value="#bean.time"/></td>
							<td class="tb-td"><s:property value="#bean.reason"/></td>
							<td class="tb-td"><s:property value="#bean.addopName"/></td>
							<td  class="tb-td" align="center">
							    <a href="javascript:pass('<s:property value="#bean.blackNum"/>')" class="blue">同意</a>
							     &nbsp;<code class="asterisk">|</code>
							      <a href="javascript:noPass(<s:property value="#bean.blackNum"/>)" class="blue">驳回</a>
							      
							</td>
							</tr>
						</s:iterator>
				</tbody>
			</table>
			</div>
		</s:form>
	<s:if test="#request.info_request !=null">
	<script language="javascript">
	    alert("${request.info_request}");
	    </script>
	</s:if>	
</body>
</html>
